//
//  PlayViewController.m
//  OpenEyes
//
//  Created by dlios on 15/9/15.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "PlayViewController.h"
#import "SaveViewController.h"
@interface PlayViewController ()

@end

@implementation PlayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title =@"音乐播放";
    self.webview =[[UIWebView alloc]initWithFrame:self.view.frame];
    NSURLRequest *requst =[NSURLRequest requestWithURL:[NSURL URLWithString:self.plurl]];
    
    [self.webview setDelegate:self];
    [self.view addSubview:self.webview];
    [self.webview loadRequest:requst];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"fanhui-3.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(left)];
    
   
    // Do any additional setup after loading the view.
}
-(void)left{
    [self.navigationController popViewControllerAnimated:YES];
}

-(void)webViewDidStartLoad:(UIWebView *)webView
{
    self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    self.HUD.removeFromSuperViewOnHide = YES;
    self.HUD.labelText = @"loading.....";
//    self.HUD.backgroundColor=[UIColor cyanColor];
    [self.view addSubview:self.HUD];
    self.HUD.mode = MBProgressHUDModeIndeterminate;
    

   
}


- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [self.HUD setHidden:YES];
}


- (void) webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{

    [self.HUD setHidden:YES];
  
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
